# 身高函数
#男，只留了20-100
def height_male(age,c0,c1,c2):
    # print(c0,c1,c2)
    if 0 <= age <= 2:
        return (49.5 + 117.0 * age) / (1 + 1.28 * age - 0.0696 * age**2)
    elif 2 < age <= 20:
        return (72.8 + 3.35 * age) / (1 - 0.0354 * age + 0.00125 * age**2)
    elif 20 < age <= 100:
        return c0 + c1 * age - c2 * age**2
        # return 175.32 + 0.1113 * age - 0.0025 * age**2
# 女，只留了18-100
def height_female(age,c0,c1,c2):
    if 0 <= age <= 2:
        return (49.1 + 101.0 * age) / (1 + 1.1 * age - 0.0627 * age**2)
    elif 2 < age <= 18:
        return (70.9 + 3.51 * age) / (1 - 0.0414 * age + 0.00175 * age**2)
    elif 18 < age <= 100:
        return c0 + c1 * age - c2 * age**2
